<template>

  <el-container class="home_container">
<!--    头部区域-->
    <el-header height="90px">
      <div class="tubiao">
        <img src="../../assets/shouyetou.jpg" alt="">
      </div>
      <div class="biaoti">糖尿病友之家后台管理系统</div>
      <el-button class="tuichu2" type="danger" @click="logout">
          <div class="tuichu">退出登录</div>
      </el-button>
    </el-header>
<!--    页面主体，包括左侧和右侧-->
    <el-container>
<!--     左边 侧边栏-->
      <el-aside width="200px"  >
          <el-button type="success" size="medium" class="zonganniu">
              <div class="anniu" @click="yonghu" >用户管理</div>   </el-button>
          <el-button type="success" v-if="yonghuguanli"  class="fenanniu">
              <div class="anniu" @click="shenhezujian" >用户审核</div>   </el-button>
          <el-button type="success" v-if="yonghuguanli" class="fenanniu">
              <div class="anniu" @click="jibenxinxizujian">用户基本信息</div></el-button>
          <el-button type="success" class="zonganniu" >
              <div class="anniu" @click="jiankang" >健康信息管理</div>   </el-button>
          <el-button type="success" v-if="jiankangguanli" class="fenanniu">
              <div class="anniu" @click="shezhibiaozujian">设置健康测评表</div></el-button>
          <el-button type="success" v-if="jiankangguanli" class="fenanniu">
              <div class="anniu" @click="yonhujiankang">用户健康信息管理 </div></el-button>
          <el-button type="success" class="zonganniu" >
              <div class="anniu" @click="luntananniu"   >论坛管理</div>   </el-button>
          <el-button type="success" v-if="luntanguanli" class="fenanniu" >
              <div class="anniu"  @click="tiezifenlei">帖子分类管理</div></el-button>
          <el-button type="success" v-if="luntanguanli" class="fenanniu">
              <div class="anniu"  @click="luntan">帖子管理</div></el-button>
          <el-button type="success" class="zonganniu">
              <div class="anniu" @click="wenzhangzujian">文章管理</div></el-button>
          <el-button type="success" class="zonganniu">
              <div class="anniu" @click="xuetangguanli">血糖管理</div></el-button>
          <el-button type="success" class="zonganniu">
              <div class="anniu" @click="yinshiguanli">饮食管理</div></el-button>
      </el-aside>
<!--      右侧内容主题-->
      <el-main>
          <router-view></router-view>
      </el-main>
    </el-container>
    </el-container>
</template>

<script>
export default {
    data() {
        return {
            yonghuguanli: false,
            jiankangguanli: false,
            luntanguanli: false,
        };
    },
    methods: {
        yonghu() {
            this.yonghuguanli = !this.yonghuguanli;
        },
        jiankang() {
            this.jiankangguanli = !this.jiankangguanli;
        },
        luntananniu() {
            this.luntanguanli = !this.luntanguanli;
        },
        //退出登录按钮操作，退出并删除token
        logout() {
            window.sessionStorage.clear()
            this.$router.push('/shouye')
        },
        jibenxinxizujian(){
            this.$router.push('/houtaihome/jibenxinxi')
        },
        shenhezujian(){
            this.$router.push('/houtaihome/shenhe')
        },
        shezhibiaozujian(){
            this.$router.push('/houtaihome/shezhibiao')
        },
        wenzhangzujian(){
            this.$router.push('/houtaihome/wenzhang')
        },

        yonhujiankang(){
            this.$router.push('/houtaihome/yonhujiankang')
        },
        luntan(){
            this.$router.push('/houtaihome/luntan')
        },
        tiezifenlei(){
            this.$router.push('/houtaihome/tiezifenlei')
        },
        xuetangguanli(){
            this.$router.push('/houtaihome/xuetangHou')
        },
        yinshiguanli(){
            this.$router.push('/houtaihome/yinshiHou')
        }

    }
}
</script>

<style scoped>
.el-header {
  background-color: #67C23A;
  display: flex;
  justify-content: space-between;
  padding-left: 0;
  align-items: center;
    line-height: 300px;
}

.home_container {
  height: 100%;

}
.tubiao {
  height: 55px;
  width: 60px;
  border: solid 1px #eee;
  border-radius: 50%;
  display: flex;
    position: absolute;
    left: 70px;

}
.biaoti {
line-height: 1.8em;
  color: white;

  font-size:30px;
    position: absolute;
    left: 550px;

}
.tuichu{

    color: white;
    font-size:18px
}
.el-header div img {

  width: 100%;
  height: 100%;
  border-radius: 50%;
    left: 10px;
}
.el-aside {
    background-color: #67C23A;
}
.el-button+.el-button{
    margin-left:0px
}

.el-button{
    border: none;
}
.el-button{
    border: none;
}
.anniu{
    color: white;
    font-size:18px;
    width: 158px;
    height: 100%;
}
.tuichu2{
    position: absolute;
    left: 1300px;
}

.el-main {
    background-color: #EAEDF1;
}
.zonganniu {
    background: darkgreen;
}
.fenanniu {
    background: green;
}
</style>
